<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
</html>
<script>
    // 题目2: 将一个字符串里的大小写字符反转一下（小写的转大写，大写的转小写）
    //     函数名：strConvert
    //     参数：源字符串
    //     返回值：大小写反转后的字符串
    //     例如：strConvert("HelloWorld") 返回 "hELLOwORLD"
    function strConvert(str){
        let c;
        let str1 = "";
        for(let i = 0;i < str.length;i ++){
            let x = str.charAt(i);
            if(x >= "a" && x <= "z"){
                c = x.toUpperCase()
            }else if(x >= "A" && x <= "Z"){
                c = x.toLowerCase()
            }
            str1 += c;
        }
        return str1;
    }
    console.log(strConvert("HelloWorld"))
</script>